

/**************************************************/
/** Document ready **/
/**************************************************/
$(document).ready(function()
{   
     //=========================COMMON EVENT============================================         
       
     $(".g_icon_gold").hover(function()
     {
        $("#g_tooltip").show();
     },function()
     {
        $("#g_tooltip").hide();
     });
   
 
 //=====================MYPAGE MAIN EVENT=====================================
    // INIT SELECT
    for(var i=1930;i<=2014;i++)
    {
            if(i==2014) $(".mypage select.year").append("<option selected='selected' value="+i+">"+i+"</option>");
            else $(".mypage select.year").append("<option value="+i+">"+i+"</option>");
            
    }
    for(var i=1;i<=12;i++)
    {
            
        if(i==5) $(".mypage select.month").append("<option selected='selected' value="+i+">"+i+"</option>");
        else $(".mypage select.month").append("<option value='"+i+"'>"+i+"</option>");
            
    }
    for(var i=1;i<=31;i++)
    {
        if(i==1) $(".mypage select.day").append("<option selected='selected' value="+i+">"+i+"</option>");
        else $(".mypage select.day").append("<option value="+i+">"+i+"</option>");
            
    }
      //CACULATOR1   
     var from_year=$(".mypage_main #collection #col3_1 .year").val();
     var from_month=$(".mypage_main #collection #col3_1 .month").val()-1;
     var from_day=$(".mypage_main #collection #col3_1 .day").val();
     var from_d=new Date(from_year,from_month,from_day);
     var to_d = new Date();
     var distance=(to_d.getTime()-from_d.getTime())/(1000*60*60*24);       
     $(".mypage_main #collection #col3_1 .pink").html(Math.floor(distance) ); 
       
      //CACULATOR2 
     var from_year=$(".mypage_main #collection #col3_2 .year").val();
     var from_month=$(".mypage_main #collection #col3_2 .month").val()-1;
     var from_day=$(".mypage_main #collection #col3_2 .day").val();
     var from_d=new Date(from_year,from_month,from_day);
     var num=$(".mypage_main #collection #col3_2 .number").val();
        
     from_d.setDate(from_d.getDate()+parseInt(num));
        
     var value=from_d.getFullYear()+"."+("0"+(from_d.getMonth()+1)).slice(-2)+"."+("0"+from_d.getDate()).slice(-2);
     $(".mypage_main #collection #col3_2 .pink").html(value); 
      //CACULATOR1   CHANGE 
    $(".mypage_main #collection #col3_1 select").change(function()
    {
        var from_year=$(".mypage_main #collection #col3_1 .year").val();
        var from_month=$(".mypage_main #collection #col3_1 .month").val()-1;
        var from_day=$(".mypage_main #collection #col3_1 .day").val();
        var from_d=new Date(from_year,from_month,from_day);
       var to_d = new Date();
       var distance=(to_d.getTime()-from_d.getTime())/(1000*60*60*24);
       
       $(".mypage_main #collection #col3_1 .pink").html(Math.floor(distance) ); 
       
    });
    //CACULATOR2 CHANGE
    $(".mypage_main #collection #col3_2 select").change(function()
    {  
        var from_year=$(".mypage_main #collection #col3_2 .year").val();
        var from_month=$(".mypage_main #collection #col3_2 .month").val()-1;
        var from_day=$(".mypage_main #collection #col3_2 .day").val();
        var from_d=new Date(from_year,from_month,from_day);
        var num=$(".mypage_main #collection #col3_2 .number").val();
        
        from_d.setDate(from_d.getDate()+parseInt(num));
        
        var value=from_d.getFullYear()+"."+("0"+(from_d.getMonth()+1)).slice(-2)+"."+("0"+from_d.getDate()).slice(-2);
        $(".mypage_main #collection #col3_2 .pink").html(value); 
    });
    
    
    
    
    
 //=====================MYPAGE ANSWER EVENT=====================================
   $(".mypage_answer .mypage_answer_list td.row2a span").click(function()
   {
        $(".mypage_answer .mypage_answer_list").hide();
        $(".mypage_answer .mypage_mypage_consult").show();
   });
   
    $(".mypage_answer .canel_body_consult_button").click(function()
   {
        $(".mypage_answer .mypage_answer_list").show();
        $(".mypage_answer .mypage_mypage_consult").hide();
   });
   
    $(".mypage_answer .mypage_answer_list td.row2b span").click(function()
   {
        $(".mypage_answer .mypage_answer_list").hide();
        
        $(".mypage_answer .mypage_answer_view").show();
   });
   
    $(".mypage_answer .canel_body_view_button").click(function()
   {
        $(".mypage_answer .mypage_answer_list").show();
        $(".mypage_answer .mypage_answer_view").hide();
   });  
   
   
   
   
   
   
   //===========================MYPAGE CANCEL EVENT=======================================
   $(".mypage_cancel #btn_count").click(function()
   {
        $(".mypage_cancel #result").show();
        $(".mypage_cancel #tip").css("margin-top","48px");
        $(".mypage_cancel #yellow_background").show();
        
        
   });    
   $(".mypage_cancel #tip #title").click(function()
   {
    toggle_popup('.mypage_cancel #cancel_popup2'); 
   });	
   $('.mypage_cancel #btn_lastest_search').click(function()
        {
         
    			toggle_popup('.mypage_cancel #search_popup'); 
    			
    	});
       $(".mypage_cancel  #search_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_cancel #search_popup");
       });
        
        
        $('.mypage_cancel #btn_avaibility').click(function()
        {
    			toggle_popup('.mypage_cancel #cancel_popup'); 
    			
    	});
       $(".mypage_cancel  #cancel_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_cancel #cancel_popup");
       });
       $(".mypage_cancel  #cancel_popup2 .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_cancel #cancel_popup2");
       });
   
   //============================MYPAGE CHANGE EVENT======================================
    $(".mypage_change #btn_count").click(function()
   {
        $(".mypage_change #result").show();
        $(".mypage_change #tip").css("margin-top","45px");
        $(".mypage_change #left #yellow_background").show();
   }); 
   
   //SEARCH POPUP
   $('.mypage_change #btn_lastest_search').click(function()
    {
			toggle_popup('.mypage_change #search_popup'); 
			
	});
   $(".mypage_change  #search_popup .btn_close").click(function(e)
   {
            
            e.stopPropagation();
            toggle_popup(".mypage_change #search_popup");
   });
   //PERSONAL POPUP
    $('.mypage_change #personal .btn_action').click(function(){
			toggle_popup('.mypage_change #personal_popup'); 
			
		});
   $(".mypage_change  #personal_popup .btn_close").click(function(e)
   {
            
            e.stopPropagation();
            toggle_popup(".mypage_change #personal_popup");
   });
   
   $(".mypage_change #personal_popup .btn_ok").click(function(e)
   {
            
            var value1=$("#personal_popup #input_1").val();
            var value2=$("#personal_popup #input_2").val();
            var value3=String($("#personal_popup #input_3").val())+"-"+String($("#personal_popup #input_4").val())+"-"+String($("#personal_popup #input_5").val());
            var value4=$("#personal_popup #input_6").val()+"-"+$("#personal_popup #input_7").val()+"-"+$("#personal_popup #input_8").val();
            
             toggle_popup(".mypage_change #personal_popup");
          //alert(value1+" "+value2+" "+value3+" "+value4);  
            $("#personal .row1 .col2").html(value1);
            $("#personal .row1 .col4").html(value2);
            $("#personal .row2 .col2").html(value3);
            $("#personal .row2 .col4").html(value4);
                
   });
   //TRANSPORT POPUP
   $('.mypage_change #transport .btn_action').click(function(){
			toggle_popup('.mypage_change #transport_popup'); 
			
    });
    
   $(".mypage_change #transport_popup .btn_ok").click(function(e)
   {
            
            var value1=$("#transport_popup #input_1").val();
            
            var value2=String($("#transport_popup #input_2").val())+"-"+String($("#transport_popup #input_3").val())+"-"+String($("#transport_popup #input_4").val());
            var value3=$("#transport_popup #input_5").val()+"-"+$("#transport_popup #input_6").val()+"-"+$("#transport_popup #input_7").val();
            var value4=$("#transport_popup #input_8").val()+"-"+$("#transport_popup #input_9").val()+" "+$("#transport_popup #input_10").val()+" "+$("#transport_popup #input_11").val();
             var value5=$("#transport_popup #input_12").val();
             toggle_popup(".mypage_change #transport_popup");
          
            $("#transport .row1 .col2").html(value1);
            $("#transport .row2 .col2").html(value2);
            $("#transport .row2 .col4").html(value3);
            $("#transport .row3 .col2").html(value4);
            $("#transport .row4 .col2").html(value5);
                
   });
   $(".mypage_change  #transport_popup .btn_close").click(function(e)
   {            
            e.stopPropagation();
            toggle_popup(".mypage_change #transport_popup");
   });
   
    //ADDRESS LIST POPUP
    $(".mypage_change #transport_popup .btn_address_list").click(function(e)
   {
            
             $(".mypage_change #address_list_popup").show();
          
   });   
    $(".mypage_change  #address_list_popup .btn_close").click(function(e)
   {            
            e.stopPropagation();
            $(".mypage_change #address_list_popup").hide();
   });
   var address_list_row_id="";
    $(".mypage_change  #address_list_popup .btn_action2").click(function(e)
   {            
          address_list_row_id=$(this).parents("tr").attr("id");
          //alert(id);
           $(".mypage_change #address_modify_popup").show();
   });
    $(".mypage_change  #address_modify_popup .btn_close").click(function(e)
   {            
            e.stopPropagation();
            $(".mypage_change #address_modify_popup").hide();
   });
   
   
   $(".mypage_change  #address_modify_popup .btn_ok").click(function(e)
   {            
            
            var value1=$("#address_modify_popup #input_1").val();
             var value2=$("#address_modify_popup #input_2").val();
            var value3=String($("#address_modify_popup #input_3").val())+"-"+String($("#address_modify_popup #input_4").val())+"-"+String($("#address_modify_popup #input_5").val());
            //var value4=$("#address_modify_popup #input_6").val()+"-"+$("#address_modify_popup #input_7").val()+"-"+$("#address_modify_popup #input_8").val();
            var value5=$("#address_modify_popup #input_11").val()+" "+$("#address_modify_popup #input_12").val();
             
             
            
            $("#address_list_popup tr#"+address_list_row_id+" td.data1").html(value1);
            $("#address_list_popup tr#"+address_list_row_id+" td.data2").html(value2);
            $("#address_list_popup tr#"+address_list_row_id+" td.data3").html(value3);
            $("#address_list_popup tr#"+address_list_row_id+" td.data4").html(value5);
            $(".mypage_change #address_modify_popup").hide();
   });
   
    $('.mypage_change #btn_avaibility').click(function()
        {
    			toggle_popup('.mypage_change #return_popup'); 
    			
    	});
       $(".mypage_change  #return_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_change #return_popup");
       });
   
/*===========================MYPAGE RETURN EVENT========================================= */
      
       $(".mypage_return #btn_count").click(function()
       {
            $("#result").show();
            $("#tip").css("margin-top","48px");
       });  
       
        $('.mypage_return #btn_lastest_search').click(function()
        {
         
    			toggle_popup('.mypage_return #search_popup'); 
    			
    	});
       $(".mypage_return  #search_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_return #search_popup");
       });
       
       
       $('.mypage_return #btn_avaibility').click(function()
        {
    			toggle_popup('.mypage_return #return_popup'); 
    			
    	});
       $(".mypage_return  #return_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_return #return_popup");
       });

       $(".mypage_return #tip #title").click(function()
       {
        toggle_popup('.mypage_return #cancel_popup2'); 
       });	
        
   //===========================MYPAGE COUPON EVENT========================================
    var currentTab=".mypage #tabs #tab-1";
    $('.mypage #tabs .tab').css("display","none");
    
    $('.mypage #tabs div#tab-1').css("display","block");
    
     
    $('.mypage #tabs #controller div a').click(function()
    {
        
        $('.mypage #tabs #controller div').removeClass('active');
        $(this).parent().addClass('active');
        currentTab = ".mypage #tabs "+$(this).attr('href');
        $('.mypage #tabs .tab').css("display","none");
        $(currentTab).css("display","block");
        return false;
    });
    
    
    /* GIFTCARD TABS */
    var current_primary_tab=".mypage_giftcard #primary_tabs #tab-1";
    $('.mypage_giftcard #primary_tabs .primary_tab').css("display","none");
    
    $(current_primary_tab).css("display","block");
   
     
    $('.mypage_giftcard #primary_tabs #controller div a.primary').click(function(event)
    {   
        $('.mypage_giftcard #primary_tabs #controller div').removeClass('active');
        $(this).parent().addClass('active');
        current_primary_tab = '.mypage_giftcard #primary_tabs '+$(this).attr('href');
        $('.mypage_giftcard #primary_tabs  #tab-1').css("display","none");
        $('.mypage_giftcard #primary_tabs  #tab-2').css("display","none");
        $('.mypage_giftcard #primary_tabs #tab-3').css("display","none");
        $(current_primary_tab).css("display","block");
        
        
        var current_second_tab=current_primary_tab+" #secondary_tabs .secondary_tab-1";
        $(current_primary_tab+' #secondary_tabs .secondary_tab-2').css("display","none");
        $(current_second_tab).css("display","block");
        
         $('.mypage_giftcard #secondary_tabs  #controller div').removeClass('active');
        
        
        $(".mypage_giftcard #secondary_tabs #controller div#c1").addClass("active");
            
        return false;
    });
    
    
     var current_second_tab=current_primary_tab+" #secondary_tabs .secondary_tab-1";
     $(current_primary_tab+' #secondary_tabs .secondary_tab-2').css("display","none");
     $(current_second_tab).css("display","block");
        
    
     
    $('.mypage_giftcard #secondary_tabs  #controller div a').click(function()
    {
        
          
        $('.mypage_giftcard #secondary_tabs  #controller div').removeClass('active');
        $(this).parent().addClass('active');
         current_second_tab='.mypage_giftcard #secondary_tabs '+$(this).attr('href').replace("#",".");
        $('.mypage_giftcard #secondary_tabs  .secondary_tab-1').css("display","none");
        $('.mypage_giftcard #secondary_tabs  .secondary_tab-2').css("display","none");
        
        
       // alert(current_second_tab);
        $(current_second_tab).css("display","block");
        
        return false;
    });
    //==========================MYPAGE WISHLISH EVENT============================================
    
    //HOVER EFFECT ON PRODUCT ITEM
    $("#product .item .product_image").hover
    (
      function()
      {  
        var quick_icon=$(this).children("#quick_icon");
        var status=quick_icon.attr("class");
        
       if(status="hide")
       {
        quick_icon.slideDown().addClass("show");
       }       
        //if($(this).siblings().attr("display")!="none") $(this).siblings().slideDown();
        
      }      
      ,function()
      {
         var quick_icon=$(this).children("#quick_icon");
        var status=quick_icon.attr("class");
        
        if(status="show")
        {
        quick_icon.slideUp().addClass("hide");
         }   
      }
    );//end hover  
    //================================MYPAGE SERVICE EVENT========================================
    
    $('.mypage_service .input_text input').keyup(function(e){
    if(e.keyCode == 13)
    {
        //alert("OK");
        $("#result").show();
        $(".mypage_service #tip").css("margin-top","45px");
        $(".mypage_service #result td#col3").html($("#input").val());
    }
   
    });
    
    $('.mypage_service #btn_lastest_search').click(function(e)
    {
       
        $(".mypage_service #tip").css("margin-top","45px");
        $(".mypage_service #result td.change").html($("#input").val());
        
    });  
    $('.mypage_service .btn_action').click(function()
        {
         
    			toggle_popup('.mypage_service #service_popup'); 
    			
    	});
       $(".mypage_service  #service_popup .btn_close").click(function(e)
       {
                
                e.stopPropagation();
                toggle_popup(".mypage_service #service_popup");
       });
    
    /*========MYPAGE QUESTION QUESTION ===================*/
     $(".mypage_question .click_able1").click(function()
     {
        
        $(".mypage_question #content1 td").css("height","189px");
        $(".mypage_question #content1 td").show();
     });
      $(".mypage_question .click_able2").click(function()
     {
        
        $(".mypage_question #content2 td").css("height","189px");
        $(".mypage_question #content2 td").show();
     });
      $(".mypage_question .click_able3").click(function()
     {
        $(this).parents("tr").removeClass("row_last");
        $(".mypage_question #content3 td").css("height","189px");
        $(".mypage_question #content3 td").show();
     });
     
/*============ MYPAGE RIPPLE EVENT =========================*/
     $(".mypage_ripple  .click_able1").click(function()
     {
        
        
        $(".mypage_ripple #content1 td").css("height","132px");
        $(".mypage_ripple #content1 td").show();
     });
       $(".mypage_ripple  .click_able2").click(function()
     {
        
        $(".mypage_ripple #content2 td").css("height","132px");
        $(".mypage_ripple #content2 td").show();
     });
       $(".mypage_ripple  .click_able3").click(function()
     {
        $(this).parents("tr").removeClass("row_last");
        $(".mypage_ripple #content3 td").css("height","132px");
        $(".mypage_ripple #content3 td").show();
     });
     
     
/*========MYPAGE BEMONEY EVENT===================*/
     $(".mypage_bemoney #btn_change").click(function()
     {
        $(".mypage_bemoney #right #main #method_change tr#row1 td").css("border-bottom","1px solid #eee");
        $(".mypage_bemoney #right #main #method_change tr#row2").show();
     });
     $(".mypage_bemoney #btn_charge").click(function()
     {
        $(".mypage_bemoney #right #main #method_change tr#row2").hide();
        $(".mypage_bemoney #right #main #method_change tr#row1 td").css("border-bottom","none");
        $(".mypage_bemoney #b_money").show();
        $(".mypage_bemoney #payment").show();
        $(".mypage_bemoney #tabs").hide();
        $(".mypage_bemoney .pagination").hide();
     });
     $(".mypage_bemoney #btn_change2").click(function()
     {
        
        alert("change3");
     });
     $(".mypage_bemoney #btn_charge2").click(function()
     {
        
      $(".mypage_bemoney #right #main #method_change tr#row2").hide();
      $(".mypage_bemoney #right #main #method_change tr#row1 td").css("border-bottom","none");
     });
     $(".mypage_bemoney #b_money #input_1").click(function()
     {
        
       $(".mypage_bemoney #payment").show();
       $(".mypage_bemoney #serial").hide();
     });  
     $(".mypage_bemoney #b_money #input_2").click(function()
     {
         $(".mypage_bemoney #payment").show();
        $(".mypage_bemoney #serial").hide();
     });  
     $(".mypage_bemoney #b_money #input_3").click(function()
     {
         $(".mypage_bemoney #serial").show();
        $(".mypage_bemoney #payment").hide();
     });
     
     
     //=====================MYPAGE ANNIVERSARY INFO=====================================================
      //CACULATOR1   
     var from_year=$(".mypage_anniversary .col1 .year").val();
     var from_month=$(".mypage_anniversary .col1 .month").val()-1;
     var from_day=$(".mypage_anniversary .col1 .day").val();
     var from_d=new Date(from_year,from_month,from_day);
     var to_d = new Date();
     var distance=(to_d.getTime()-from_d.getTime())/(1000*60*60*24);       
     $(".mypage_anniversary .col1 .gray").html(Math.floor(distance) ); 
       
      //CACULATOR2 
     from_year=$(".mypage_anniversary .col2 .year").val();
     from_month=$(".mypage_anniversary .col2 .month").val()-1;
     from_day=$(".mypage_anniversary .col2 .day").val();
     from_d=new Date(from_year,from_month,from_day);
     num=$(".mypage_anniversary .col2 .number").val();
        
     from_d.setDate(from_d.getDate()+parseInt(num));
        
     value=from_d.getFullYear()+"."+("0"+(from_d.getMonth()+1)).slice(-2)+"."+("0"+from_d.getDate()).slice(-2);
     $(".mypage_anniversary .col2 .gray").html(value); 
     
     
      //CACULATOR1   CHANGE 
    $(".mypage_anniversary #caculation .col1 select").change(function()
    {
        var from_year=$(".mypage_anniversary #caculation .col1 .year").val();
        var from_month=$(".mypage_anniversary #caculation .col1 .month").val()-1;
        var from_day=$(".mypage_anniversary #caculation .col1 .day").val();
        var from_d=new Date(from_year,from_month,from_day);
       var to_d = new Date();
       var distance=(to_d.getTime()-from_d.getTime())/(1000*60*60*24);
       
       $(".mypage_anniversary #caculation .col1 .gray").html(Math.floor(distance) ); 
       
    });
    //CACULATOR2 CHANGE
    $(".mypage_anniversary #caculation .col2 select").change(function()
    {  
        from_year=$(".mypage_anniversary #caculation .col2 .year").val();
        from_month=$(".mypage_anniversary #caculation .col2 .month").val()-1;
        from_day=$(".mypage_anniversary #caculation .col2 .day").val();
        from_d=new Date(from_year,from_month,from_day);
        num=$(".mypage_anniversary #caculation .col2 .number").val();
        
        from_d.setDate(from_d.getDate()+parseInt(num));
        
        var value=from_d.getFullYear()+"."+("0"+(from_d.getMonth()+1)).slice(-2)+"."+("0"+from_d.getDate()).slice(-2);
        $(".mypage_anniversary #caculation .col2 .gray").html(value); 
    });  
    
    $(".mypage_anniversary #btn_notime").click(function()
    {
       
      $(".mypage_anniversary .data").show(); 
      $(".mypage_anniversary #right #calendar .col2 p.first").css("border-bottom","none");
      $(".mypage_anniversary .control").hide(); 
    });
     $(".mypage_anniversary #calendar_btn2").click(function()
    {
       
      $(".mypage_anniversary .data").hide(); 
      $(".mypage_anniversary .control").show();  
    });
    
    
    
//==================MYPAGE MODIFY EVENT ===========================================================


	$('.mypage_info_modify #btn_lastest_search').click(function()
	{
			toggle_popup('.mypage_info_modify #search_popup'); 
			
	});
	$(".mypage_info_modify  #search_popup .btn_close").click(function(e)
	{
			
			e.stopPropagation();
			toggle_popup(".mypage_info_modify #search_popup");
	});
	//end popup mobile
	$('.mypage_info_modify #btn_lastest_mobile').click(function()
	{
			toggle_popup('.mypage_info_modify #mobile_popup'); 
			
	});
	$(".mypage_info_modify  #mobile_popup .btn_close").click(function(e)
	{
			
			e.stopPropagation();
			toggle_popup(".mypage_info_modify #mobile_popup");
	});//end popup mail
	$('.mypage_info_modify #btn_lastest_mail').click(function()
	{
			toggle_popup('.mypage_info_modify #mail_popup'); 
			
	});
	$(".mypage_info_modify  #mail_popup .btn_close").click(function(e)
	{
			
			e.stopPropagation();
			toggle_popup(".mypage_info_modify #mail_popup");
	});//end popup mobile
   
   //=========================== Tabs ========================================
    var currentTab="#tab-1";
    $('#tabs .tab').css("display","none");
    
    $('#tabs div#tab-1').css("display","block");
    
     
    $('#tabs #controller div a').click(function()
    {
        $('#tabs #controller div').removeClass('active');
        $(this).parent().addClass('active');
        currentTab = $(this).attr('href');
        $('#tabs .tab').css("display","none");
        $(currentTab).css("display","block");
        return false;
    });
	
	//Lick tab radio
	$("#radio_click1 #tab2rad1").click(function()
    {
	  $('#radio_click1 label').removeClass('rad_active');
      $("#tab2rad_content1").show();
      $("#tab2rad_content2").hide(); 
	  $("#tab2rad_content3").hide(); 
	  $(this).parent().addClass('rad_active');
    });
	$("#radio_click1 #tab2rad2").click(function()
    {
	  $('#radio_click1 label').removeClass('rad_active');
      $("#tab2rad_content1").hide();
      $("#tab2rad_content2").show();
	  $("#tab2rad_content3").hide();
	  $(this).parent().addClass('rad_active');
    });
	$("#radio_click1 #tab2rad3").click(function()
    {
	 $('#radio_click1 label').removeClass('rad_active');
      $("#tab2rad_content1").hide();
      $("#tab2rad_content2").hide(); 
	  $("#tab2rad_content3").show();
	  $(this).parent().addClass('rad_active');
    });
   
    
 //================================HACK ALL BROWSER TO HAVE A SAME LOOKING=================================
 //HACK ALL BROWSER TO HAVE A SAME LOOKING
        //alert(navigator.userAgent.toLowerCase());
        if(navigator.userAgent.toLowerCase().indexOf('msie 7')!=-1)
        { 
           $(".g_icon_user").width("14px");
           $(".g_icon_user").height("14px");
           
            //brand fix
           $(".mypage_brand .action").css("line-height","30px");
            
           //mypage_cancel fix
           $(".mypage_cancel #right #main #tip").css("margin-top","50px");
           $(".mypage_cancel #right #main #result tr#row1").height("36px");
           $(".mypage_cancel #right #main #result tr#row2").height("81px");
           $(".mypage_cancel #right #main #result tr#row3").height("41px");
           $(".mypage_cancel #right #main #result tr#row4").height("40px"); 
                   
           //mypage_change fix
           $(".mypage_change #transport .btn_action").css("line-height","24px");
           $(".mypage_change #personal .btn_action").css("line-height","24px");
           $(".mypage_change #right #main #result tr#row1").height("36px");
           $(".mypage_change #right #main #result tr#row2").height("81px");
           $(".mypage_change #right #main #result tr#row3").height("41px");
           $(".mypage_change #right #main #result tr#row4").height("40px");
           
           //mypage_coupon fix           
           $(".mypage_coupon #top_tab1 div.title_tab1 img").css("margin-top","8px");
           //mypage_wishlis fix
           $(".mypage_wishlist #top_tab1 div.title_tab1 img").css("margin-top","8px");
           $(".mypage_wishlist .action").css("line-height","30px");  
           //mypage_service fix
           
           $(".mypage_service .action").css("line-height","22px");   
           //mypage_review
           //mypage_review
            $(".mypage_review .action").css("line-height","29px"); 
        }
        else if(navigator.userAgent.toLowerCase().indexOf('msie 8')!=-1)
        {     
            $("#right #top #g_left #g_text").css("top","40px");
            $("#right #top #g_right .g_right_title").css("top","41px");
            $("#right #top #g_left #g_icon p").css("margin-top","9px");
            
            //brand fix
            $(".mypage_brand .action").css("line-height","30px");  
              
            //mypage_cancel fix
            $(".mypage_cancel #right #main #result th#col2").width("81px");
            //mypage_change fix
            $(".mypage_change #right #main #result th#col2").width("81px");
            $("#transport .btn_action").css("line-height","24px");
            $("#personal .btn_action").css("line-height","24px");
            //mypage_wishlist fix
            $(".mypage_wishlist .action").css("line-height","30px"); 
            //mypage_service fix
            $("mypage_service .action").css("line-height","22px");  
            //mypage_review
            $(".mypage_review .action").css("line-height","29px"); 
        }
        else if(navigator.userAgent.toLowerCase().indexOf('msie 9')!=-1)
        { 
             
           
           $("#right #main #cancel p#content").css("margin-bottom","16px");
           
           
           $("#right #top #g_right .g_right_title").css("top","42px");
           $("#right #top #g_left #g_text").css("top","40px");
           //brand fix
           $(".mypage_brand .action").css("line-height","30px");  
           //mypage_change fix
            $(".mypage_change #right #main #result th#col2").width("81px");
             $("#transport .btn_action").css("line-height","24px");
            $("#personal .btn_action").css("line-height","24px");
            //mypage_wishlist fix
            $(".mypage_wishlist .action").css("line-height","30px");  
            //mypage_servic fix
             $(".mypage_service .action").css("line-height","26px"); 
             //mypage_review
             $(".mypage_review .action").css("line-height","30px");  
        }
        else
        {
            
              
            $("#right #top #g_left #g_text").css("top","40px");
            $("#right #top #g_right .g_right_title").css("top","42px");
            //brand fix
            $(".mypage_brand .action").css("line-height","30px");
            //mypage_change fix
            $(".mypage_change #right #main #result th#col2").width("81px");
             $("#transport .btn_action").css("line-height","24px");
            $("#personal .btn_action").css("line-height","24px");
            //mypage_wishlist fix
            $(".mypage_wishlist .action").css("line-height","30px");  
            //mypage_service fix
            $("mypage_service .action").css("line-height","25px"); 
            //mypage_review
             $(".mypage_review .action").css("line-height","30px");  
        }
        
        
//=========================POPUP EVENT=====================================================================================
        
        
         var mywidth=$("body").width();
    
        var wid_set=(mywidth-$(".mypage_popup").width())/2;
         $(".mypage_popup").css("left",wid_set)
        
       
        $("#overflow").click(function(e)
        {
            toggle_popup(".mypage_popup");
            e.stopPropagation();
            
        });
         $(".mypage_popup").click(function(e)
         {
            e.stopPropagation();
         });
       
        var status="";
        //FUNTION TO OPEN/CLOSE POPUP
        function toggle_popup(target)
        {
            if(status!="active")
            {
                $("#overflow").show();
                $(target).fadeIn(400);
                status="active";
               
            }
            else
            {

                 $(target).fadeOut(100);
                 $("#overflow").hide();
                 status="";
            }
        }
		
		
   
});